package com.badlogic.androidgames.framework;

import com.badlogic.androidgames.framework.math.Vector2;

public class DynamicGameObject extends GameObject {
    public final Vector2 velocity;
    public final Vector2 accel;
    
    public DynamicGameObject(float x, float y, float width, float height) {
        super(x, y, width, height);
        velocity = new Vector2();
        accel = new Vector2();
    }
    public void hitSomething(GameObject something)
	{
		velocity.x = -velocity.x;
		position.x = position.x > something.position.x ? something.position.x + something.bounds.width / 2 + this.bounds.width /2  : something.position.x - something.bounds.width / 2 - this.bounds.width /2;
	}
}
